#pragma once
#include<iostream>
using namespace std;

typedef int Heapdata;

class heap {

public:
	heap(int n = 4)
	{
		a = (Heapdata*)malloc(sizeof(Heapdata) * n);
		if (a == nullptr)
		{
			perror("malloc fail");
			exit(-1);
		}
		size = 0;
		capacity = n;

	}
	int rsize()
	{
		return size;
	}
	int rcapacity()
	{
		return capacity;
	}
	void heappush(int* a, int x);
	void heappop(int* a);
	int heaptop(int* a);
	int heapsize(int* a);
	~heap()
	{
		free(a);
		a = nullptr;
		size = capacity = 0;
	}
private:
	Heapdata* a;
	int size;
	int capacity;
	
};